<?php
defined('IN_TS') or die('Access Denied.');

//找出所有的投票 最新投票
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = tsUrl('vote','index',array('page'=>''));
$lstart = $page*10-10;
$newsNum = $new['vote']->findCount('vote',array(
    'ischeck'=>1,
));
$pageUrl = pagination($newsNum, 10, $page, $url);

$arrVote = $new['vote']->findAll('vote',array(
    'ischeck'=>1,
),'addtime desc',null,$lstart.',10');
foreach($arrVote as $k=>$v){
    $arrVote[$k]['user']=aac('user')->getOneUser($v['userid']);
    $arrVote[$k]['vote']=$new['vote']->findAll('vote_option',array(
        'voteid'=>$v['voteid'],
    ),null,null,'2');
}

//找出热门投票
$arrHotVote = $new['vote']->findAll('vote',array(
    'ischeck'=>1,
),'count_comment desc',null,'10');


$title ="投票";
include template("index");